package com.example.administrator.newjiajiesong.test;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.newjiajiesong.R;

import java.util.List;


/**
 * Created by: xudiwei
 * <p>
 * on: 2017/5/9.
 * <p>
 * 描述：邀请消息列表适配器
 * @deprecated
 */

public class InviteMessageAdapter extends BaseRecyclerViewAdapter<CommunityMessageBean.MsgBean> {
    private static final String TAG = "InviteMessageAdapter";

    public InviteMessageAdapter(Context context, List<CommunityMessageBean.MsgBean> list) {
        super(context, list);
    }

    @Override
    public void onBindViewHolderNormalItem(RecyclerView.ViewHolder holder, int position) {
        AddFriendMessageViewHolder viewHolder = (AddFriendMessageViewHolder) holder;
        CommunityMessageBean.MsgBean msgBean = mList.get(position);
        viewHolder.tvNickname.setText(msgBean.getNick_name());
        viewHolder.tvReason.setText(msgBean.getContent());
        Log.d(TAG, "msg: " + msgBean.getImg());
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolderNormalItem(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_rv_add_friend_message, parent, false);
        return new AddFriendMessageViewHolder(view);
    }

    private class AddFriendMessageViewHolder extends RecyclerView.ViewHolder {
        TextView tvNickname;
        TextView tvReason;
        TextView tvAccept;
        TextView tvReject;


        AddFriendMessageViewHolder(View itemView) {
            super(itemView);
            tvNickname = (TextView) itemView.findViewById(R.id.tv_nickname);
            tvReason = (TextView) itemView.findViewById(R.id.tv_reason);
            tvAccept = (TextView) itemView.findViewById(R.id.tv_accept);
            tvReject = (TextView) itemView.findViewById(R.id.tv_reject);
        }
    }
}
